package jpb.module.dao.member;

import jpb.module.dao.member.mapper.MemberLogMapper;
import jpb.module.daomain.member.Member;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * Created by haol on 2017/5/11.
 */
@Repository
public class MemberLogDao {


        @Autowired
        private MemberLogMapper mapper;
        private Logger logger = LoggerFactory.getLogger(MemberLogDao.class);


        public Member get( String num){
                try{
                        return mapper.get(num);
                }catch (Exception e){
                        logger.error(e.getMessage());
                        return null;
                }
        }

        public void updateLoginTime(String num, Date time){
                try{
                        mapper.updateLoginTime(num,time);
                }catch (Exception e){
                        logger.error(e.getMessage());
                }
        }
        public void register( Member member){
                try{
                         mapper.register(member);
                }catch (Exception e){
                        logger.error(e.getMessage());
                }
        }
}
